OpenCities Map Help

Inference Rules Tab

Used to control processing raw feature stock directly from the user session.

Launch an XFM Project map session from the Geospatial Administrator or your previously defined shortcut.

You can access this dialog from the following.
  • Ribbon: Map Admin > Home > Map Configuration group > Inference Rules

    From the Feature Definitions and Inference Rules dialog, select the Inference Rules tab.



Note: Tab Behaviour
  • Every information displayed in this dialog is saved in the WorkSet.
  • There is only one set of rules per WorkSet.
SettingDescription
General Tools Section


Save
  • Enables when a modification is done in the dialog. Click to save all modifications.
Rules Enabling/ Disabling
  • When the rules are disabled, all the inference rules defined in this WorkSet are ignored by the XFM engine.
Help Contents
  • Opens the help in the PDF file.
Feature Inference Rules Section


Note: The first time we enter this dialog after creating a WorkSet, the Apply Legacy DFS Rules is active by default. After that, its value is saved in the rules file.
Global Section Behaviour

This section will display the rules as they are saved. If a targeted feature no longer exists in the schema:

  • The Feature is displayed in red for rules that infer that Feature (see image above).
  • These rules are ignored by the XFM engine as the Active toggle is disabled.
  • The entire Feature Properties section for these features cannot be edited (read-only).


When a rule is selected, the software virtually selects all the other rules that target the same feature.
  • The tools of this section only affect the selected lines (dark blue).
  • The virtually selected rules (light blue) are only used in the Feature Properties section below.
Grid Description
Leftmost column
  • This column has multiple uses.
  • It displays the active line with an arrow.
  • It also indicates the lines that have been edited since the last save with an icon.
  • Clicking on this column header, will select all the rules.
Condition
  • Display the condition that defines the rule.
  • Rules are evaluated in the order they are listed in the grid.
  • When a rule is valid for an element, the following rules are not evaluated, and the evaluation restarts at the first rule with the next element.
Geometry Icon
  • This column displays an icon that shows the geometry type of the selected feature.
Feature
  • Used to select the target feature.
  • The CAD element is treated as if it were a feature of this type. This is called an Inferred Feature.
  • It is only possible to select features that are defined in the active schema.
Autopromote
  • Used to determine what the software should do when a new CAD element is about to be written to DGN and validates this rule.
  • Three options are available to activate Autopromote.
    • No: The element is written in the DGN without any action.
    • Show Properties: The dialog to set the property values is open (Promote dialog). If tyou press the OK button, the CAD element is promoted as a Native Feature using the given property values. The CAD element is written without any action if the Cancel button is pressed.
    • Do Not Show Properties: The dialog for setting property values does not open. The CAD element is automatically promoted as a Native Feature using the Initial Value to set property values. If the Initial Value is not defined, the property value is not set.
Tool description
Add
  • This button allows you to add a line in the grid and opens the Condition Editor dialog box to define the condition of the new inference rule at the bottom of the list.


  • The new line is added with the following values:
    • Rule is active.
    • The condition defined in the Condition Editor dialog, is displayed in the Condition column.
    • We see a question mark (?) in the geometry column.
    • The column Feature is set to *Unassigned*.
    • The column Autopromote is set to No.
Copy
  • The selected rules (dark blue lines) are copied to the clipboard (The rules can only be pasted in the same grid).
  • The multiple selection is supported.
Paste
  • The rules taken from the clipboard, are pasted at the end of the list of rules.
Delete
  • The selected rules (dark blue lines) are deleted.
Move Up and Move Down
  • All the selected rules are moved up (or down) one position.
  • If some rules reach the top (bottom) of the list, then these rules stop moving.
  • The intermediate order of the selected rules never changes.
Generate
  • When this tool is started, it first checks that Feature Inference Rules targeting the selected feature are saved. If there is one rule not saved, then a message will advise you to save before executing the generate.
  • This tool scans the elements of the current and referenced model to generate rules for all different values of the targeted symbology.
MyFeatureName Feature Properties Section


Global Section Behavior

This section is divided into two subsections.

  • One to create rules that infer a value to a feature property.
  • One to assign a value to a feature property.
The label of the main section follows the rules mentioned below:
  • When the selection in the Feature Inference Rules section targets only one feature: The label is: “the display name of the target feature” Feature Properties.
  • When the selected rules target more than one feature:
    • The label is: Feature Properties.
    • All the tools under the Feature Properties section are deactivated.
  • When the selected rule does not have a feature assigned yet:

    • The label is: Unassigned Feature Properties.
    • All tools under the Feature Properties section must be deactivated.

If there is a property that is used in these sections that no longer exists in the schema, then that property is displayed in red. Additionally, rules that assign or infer a value to this property are ignored by the XFM engine.

The rules are evaluated in the order they are listed. When a rule is true, it stops looking at the other rules that infer a value to the same property.

Infer Values Sub-Section Global Section Behavior


  • This section infers a value from the feature property when a condition is validated. However, the software has no way of knowing the value to assign to the property. Therefore, the administrator will have to tell the software how to interpret the condition.
  • Except for the Active column, all the fields in this grid are read-only. The Add or Edit control is used to modify anything.
  • Only columns with value are displayed. For example, in the image above, the columns Level and Weight are not displayed because they are set to *ANY* for all lines.
Grid Description

Leftmost column

  • This column has multiple uses.
  • It displays the active line with an arrow.
  • It indicates the lines that have been edited since the last save with an icon.
  • Clicking on the column header, will select all the rules.
The Active toggle
  • When this toggle is turned off, the rule is persisted, but the XFM engine ignores it.
  • This is the only field that can directly be edited in the grid.
The Property column
  • Shows the feature property to which the rule will infer a value.
  • All the rules for the same property are grouped (consecutive).
The Value column
  • This is the value the property set to when the condition defined by the right columns is true.
The symbology columns
  • The number of columns and the labels are different depending on the geometry type of the feature.
    • Linear (the dialog example): Level, Color, Style, Weight.
    • Polygon: Level, Outline Color, Outline Style, Outline Weight, Fill Color and

      Area Type (None, Hatch, Cross Hatch, Patterning)

      • Line Color (Color of the lines if the area is Hatch or Cross Hatch)
      • Line Style (Style of the lines if the area is Hatch or Cross Hatch)
      • Line Weight (Weight of the lines if the area is Hatch or Cross Hatch)
      • Cell Name (Name of the cell used if the area is Patterning)
    • Cell: Level, Color, Style, Weight, Cell Name, Scale X, Scale Y, Scale Z, Angle.
    • Text: Level, Color, Text Style, Weight, Font.
  • Each column shows the symbology value that validates the rule.
  • The column is considered valid when set to *Any*.
  • The rule is valid when all columns are valid. This is a logical AND between the column and not an OR.
Tool descriptions

Add

  • This tool is used to create an inference rule manually.
  • The rule is added at the end of the group of the same property. It is added at the end of the list if it is the first rule for that property.
  • This tool starts the Property Values Inference Rule dialog.
  • This dialog is different depending on the geometry type of the feature.
    • Lines


    • Polygons


    • Cells


    • Texts


Edit
  • Edit tool is to modify an infer values rule.
  • The tool only works if only one rule is selected.
  • This tool opens the same dialog as Add.
Copy
  • This tool takes a copy, in the clipboard, of the selected rules.
  • Rules can only be pasted into the same grid.
Paste
  • Paste the rules at the end of the grid.
Delete
  • Delete the selected rules.
Move Up and Move Down
  • All the selected rules are moved up (or down) one position.
  • If some rules reach the top (bottom) of their group, then these rules stop moving.
  • The intermediate order of the selected rules never changes.
Generate
  • When this tool is started, it first checks that Feature Inference Rules targeting the selected feature are saved. If there is one rule not saved, then a message will advise you to save before executing the generate.
  • This tool scans the elements of the current and referenced model to generate rules for all different values of the targeted symbology.
Assign Values Sub-Section


Global Section Behaviour
  • In this section, the rule assigns the value returned by the expression to a property.
  • If the expression cannot be evaluated, the property is assigned the Default value.
  • If a targeted property, no longer exists in the schema:
    • The property is displayed in red in the rule.
    • This rule is ignored by the XFM engine as if the Active toggle was disabled.
Grid Description
Leftmost column
  • This column has multiple uses.
  • It displays the active line with an arrow.
  • It also indicates, with an icon, the lines that have been edited since the last save.
  • Clicking on the column header, will select all the rules.
The Active toggle
  • When this toggle is turned off, the rule is persisted, but the XFM engine ignores it.
  • This is the only field that can directly be edited in the grid.
Property
  • Displays the feature property to which the rule will assign a value.
Expression
  • This column displays the expression to be evaluated.
  • If the expression does not return a value, then the default value is used.
  • This field can be left empty, in which case the default value is automatically used.
  • In the OpenCities Map documentation, there is a long list of Expression examples to help you write your expression.
Default Value
  • Value used to set the property value if the expression cannot be evaluated or if the expression field is empty.
Tool description
Add




  • This tool opens the Property Value Assignment Rule dialog.
  • This dialog is used to define the assignment rule.
  • It has three fields:
    • Property
      • Used to select the property we want to assign a value to.
      • The properties listed in that list are only:
        • The property of type: textBox.
        • The properties not already used in the InferValues or Assign Values sections.
      • When open, this field is initiated with the first property not already used.
    • Expression / Date Expression
      • This is the expression to be evaluated to assign a value to the property.
      • This expression can be left empty. When it does, it is written (None) in the grid column.
      • If the property is of type date, the dialog is different to help the user enter a date.
    • Default Value / Default Date
      • Constant value entered by the user.
      • This value is assigned to the property if the expression cannot be evaluated, or the expression field is left empty.
      • If the expression is left empty, then this field must be completed for the OK button to be activated.
Edit
  • This tool works when one, and only one, rule is selected.
  • It opens the same dialog as the Add, but the fields are already filled with the value of the selected rule.
  • Please read the Add description above for the behavior details.
Delete
  • Deletes the selected rules.
The Feature Inference Rules Generate Tool This tool is executed from the Feature Inference Rules tools ribbon.


  • The top section allows you to filter the elements that will be used to generate rules.
  • In the lower section, the user can choose to let the software automatically generate, in the active schema, a new feature definition for each generated rule. If this option is not used, the user must manually assign a schema feature to each rule.
  • Here are more details on the top section:
    • By default, the Generate rules by level and Generate rules by cell Name are set to on.
    • When the OK is pushed, the scan of the DGN starts as described below:

      Scan all the CAD elements (see restrictions below) in the master model and the attached models.

      • The Native Feature elements are not scanned.
      • Only the supported element types are scanned.
      Rules are generated to handle all groups of elements as described below.
    • If there are elements with different geometry types on the same level, then a different rule is created for each geometry type.
  • Bottom Section:The following is applied only when the toggle Automatically Generate Features is on. These are the default names generated for the feature definitions:
    • For the levels, the generated feature definitions are named: LevelName_Geometry, where geometry can be: Text, Line, Poly.
    • For the cells, the Generated feature definitions are named: CellName_Cell.
    • For the Text element, extra work needs to be done.
      • A Text property of 50 characters is created named: "Text_String".
      • A PBA is also created to display that string at the same location.
The Infer Value Generate Tool The Generate tool analyzes all the elements that validate one of the inference rules highlighted in blue (dark and light) in the Feature Inference Rules section at the top of the dialog.


Dialog details
  • The dialog is different depending on the geometry type of the targeted feature:
    • For Linear Features


    • For Polygonal Features


    • For Cell Features


    • For Text Features


  • The Property pull-down menu
    • Only the properties defined in the schema are listed here.
    • Only the properties of type TextBox are listed here.
    • The properties are listed in alphabetical order.
    • If a property is already used in the Assign Value section, it will not be listed here. It is not possible to give a value to a property in the Infer Values and in the Assign Values simultaneously.
Behavior of the tool


  • This tool is executed from the Infer Values tools ribbon.
  • Initially a warning dialog box may appear if any of the rules (dark blue and light blue) need to be saved. In other words, one of the rules has been changed and the Save Rules button has not been pressed. The following message is displayed:

    “To generate Infer Property Values rules, the modified inference rules must first be saved. Do you want to save the changes?”

  • Then the Generate Property Values dialog box is displayed to allow you to select:
    • Which property you want to assign a value to?
    • What symbology attribute do you want to scan?
    • Important:
      • If the tool is used more than once on the same property of the same feature.
      • But you select a different symbology to scan.
      then it must advise that you will lose your previous rules because you have not selected the same symbology.
  • Then click the OK button to start the scan.
    • After the scan is executed the dialog populates with the result of the scan as shown in the example below:
      • The property to infer value to is Size.
      • This is a property of a linear feature.
      • The scanned symbology is the color.


      Where:
      • By default, the active column is set to ON.
      • All entries of the Property column are set to the property name selected in the previous dialog.
      • All entries of the Value column are empty. This indicates the value assigned to the property depending on the symbology value.

        You have to enter these values as the program does not know what those values are.

      • Each entry of the symbology (here color) is set with the different values found by the scan. There will be as many lines as the number of color values found while scanning the elements.
      • There is an extra line added at the end. This special line is used to set the property value if an element does not validate any rules. For example: if a line is set to the color 20.
  • Final step to have valid rules.
    • It is now the time for you to edit the column value to set the values you want to assign depending on the symbology value.
    • The user can also decide that one of the symbology values needs to be ignored. To ignore a value, the user only needs to turn off the Active column.
      Note: You can also delete the line. But in this case, if you run the Generate tool on another DGN, this line may be regenerated, and you will have to delete it again.


    In this example:
    • If the line has the color 2, the size property is set to 6.
    • If the line has the color 19 then, the size property is set to the default value of 999, since this line is not active.
    • If the line is set to color 20 then, the size property is set to the default value 999, since no line defines that value.